home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
btrees2.arc
/
BTEXPORT.C
< prev
next >
Wrap
Text File
|
1984-12-14
|
2KB
|
62 lines
/* btexport */
#include <stdio.h>
#include <btextern.h>
int btexport ()
/* send values to outside world */
{
int offset, seg;
/* check if return code is bad */
if (gretcode) { /* yes me bad ! */
offset = peek (INTINT, 0) + 2 * sizeof (int);
seg = peek (INTINT + sizeof (int), 0);
pokew (offset, seg, NULL); /* poke NULL filehandle */
offset += sizeof (int);
pokew (offset, seg, gretcode); /* poke bad return code */
offset += sizeof (int);
pokew (offset, seg, NULL); /* poke null data pointer */
return; /* out of btsys */
} /* end if */
switch (gfcode) {
case 1 :
case 2 :
offset = peek (INTINT, 0) + 2 * sizeof (int);
seg = peek (INTINT + sizeof (int), 0);
pokew (offset, seg, gfilhand);
offset += sizeof (int);
pokew (offset, seg, gretcode);
offset += sizeof (int);
pokew (offset, seg, NULL); /* poke NULL data pointer */
break;
case 3 : /* file close */
case 4 : /* insert key */
offset = peek (INTINT, 0) + 2 * sizeof (int);
seg = peek (INTINT + sizeof (int), 0);
pokew (offset, seg, NULL); /* NULL file handle */
offset += sizeof (int);
pokew (offset, seg, gretcode); /* send return code */
offset += sizeof (int);
pokew (offset, seg, NULL); /* NULL data pointer */
break;
case 5 : /* random read */
offset = peek (INTINT, 0) +2 * sizeof (int);
seg = peek (INTINT + sizeof (int), 0);
pokew (offset, seg, NULL); /* NULL file handle */
offset += sizeof (int);
pokew (offset, seg, gretcode);
offset += sizeof (int);
pokew (offset, seg, gdatapt); /* return data pointer */
break;
default:
break;
} /* end of switch */
} /* end of btexport */